<?php namespace web\home\controller;
/** .-------------------------------------------------------------------
 * |  Software: [HDPHP framework]
 * |      Site: www.hdphp.com
 * |-------------------------------------------------------------------
 * |    Author: 向军 <2300071698@qq.com>
 * |    WeChat: aihoudun
 * | Copyright (c) 2012-2019, www.houdunwang.com. All Rights Reserved.
 * '-------------------------------------------------------------------*/
//	前台首页控制器
class Content extends Common{
	//首页
	public function index() {
		$aid=Q('get.aid',0,'intval');
		
//		根据aid查找文章内容数据，分配到页面输出		
		$arcData=Db::table('article')->join('article_data','aid','=','article_aid')->where('aid',$aid)->first();
		

//		将对应的标签数据压入到文章数据中
		$arcData['tag']=Db::table('tag')->join('article_tag','tid','=','tag_tid')->field(array('tid','tname'))->where('article_aid',$aid)->get();
//		p($arcData);die;


		$catdata=Db::table('article')->join('category','category_cid','=','cid')->where('aid',$aid)->get();
		View::with('catdata',$catdata);
		View::with('arcData',$arcData);
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		View::make();
	}
	
	
	
	
	
}